//
//  netPageViewController.m
//  myselfTest
//
//  Created by Lucifer on 15-5-20.
//  Copyright (c) 2015年 xuxzhou. All rights reserved.
//

#import "netPageViewController.h"

@interface netPageViewController ()<UIWebViewDelegate>
@property(nonatomic,strong)UIWebView * webView;
@property(nonatomic,strong)UIActivityIndicatorView * activityView;
@end

@implementation netPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)-64)];
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:_webUrlStr]];
    [self.view addSubview: _webView];
    _webView.delegate=self;
    [_webView loadRequest:request];
    _activityView=[[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(250, 30, 30, 30)];
    _activityView.activityIndicatorViewStyle=UIActivityIndicatorViewStyleWhiteLarge;
    _activityView.center=self.view.center;
    _activityView.backgroundColor=[UIColor clearColor];
    _activityView.color=[UIColor lightGrayColor];
    [_activityView startAnimating];
    
    [self.view addSubview:_activityView];
    
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [_activityView stopAnimating];
    _activityView.hidden=YES;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
